package com.iepacj.thkjava.innerclass;

public class Parcel5 {

	/**
	 * 类PDestination是方法destination的一部分
	 * 所以在destination()方法之外, 不能访问PDestination类
	 * @Method: destination
	 * @param s
	 * @return
	 */
	public Destination destination(String s) {
		
		class PDestination implements Destination{

			private String label;
			
			public PDestination(String whereTo) {
				this.label = whereTo;
			}
			
			public String readLabel() {
				return label;
			}
		}
		return new PDestination(s);
	}
	
	public static void main(String[] args) {
		Parcel5 p = new Parcel5();
		Destination dest = p.destination("hahahaha");
		System.out.println(dest.readLabel());
	}
}







